package com.swust.exam.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swust.exam.dao.StudentsMapper;
import com.swust.exam.pojo.Students;

@Service
public class StudentsService {
	@Autowired
	private StudentsMapper studentsMapper;
	
	public Students get(int id){
		return studentsMapper.selectByPrimaryKey(id);
	} 
	
	public int delete(int id) {
		return studentsMapper.deleteByPrimaryKey(id);
	}
	
	public int insert(Students students) {
		return studentsMapper.insert(students);
	}
	
	public int update(Students students) {
		return studentsMapper.updateByPrimaryKey(students);
	}

	public List<Students> GetDetailStudentsInfo(){
		return studentsMapper.GetDetailStudentsInfo();
	}
	
}
